package com.ibeeking.found.upms.cs.rest.service.impl;

import com.ibeeking.found.common.constants.RoleConstant;
import com.ibeeking.found.upms.cs.rest.service.ICsRoleService;
import com.ibeeking.found.upms.service.common.dos.CsRoleDO;
import com.ibeeking.found.upms.service.mapper.CsRoleMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName CsRoleServiceImpl
 * @Description
 * @Author ibeeking
 * @Date 2021-05-13 11:42
 **/
@Service
public class CsRoleServiceImpl implements ICsRoleService {

    @Resource
    private CsRoleMapper csRoleMapper;

    @Override
    public Long selectAdministratorId() {
        CsRoleDO roleDO = csRoleMapper.selectOne(new LambdaQueryWrapper<>(CsRoleDO.class).eq(CsRoleDO::getCode, RoleConstant.ADMINISTRATOR));
        return roleDO.getId();
    }
}
